
********************************************************************************
*
* Title:	WHO GETS TARGETED WITH SOFT POWER? 
*			EVIDENCE FROM KISSINGER'S INTERNATIONAL SEMINAR
*
* Authors: 	Adam Scharpf
*
* Journal:	World Politics
*
* Date:		September 2024
*
********************************************************************************
*
* Content:	Replication of results in the manuscript and supporting information
*
*			Steps:
*			1) Set working directory below ("Setting working directory in macro")
*			2) Run do-file
*			3) Replicate results and figures
*
********************************************************************************
*
* Packages: Before running this code, please make sure you have the following
*			.ado-files installed
*
*			- Parmest Package, Version 2
*					net install st0043_2.pkg
*
*			- Map package
*					ssc install spmap
*
********************************************************************************


	version 16.0
	set more off

	clear all
 
 
********************************************************************************
*
* Setting working directory in macro
*
********************************************************************************

	*Insert path to folder containing replication datasets before running
	//Example: "C:\Users\me\Desktop\Scharpf_WP_Kissinger"
	global path="..." 
 
 
********************************************************************************
*
* Producing log-file of results
*
********************************************************************************

	*Start recording log file
	log using "$path\replication_log", replace

	
********************************************************************************
*
* Figures in manuscript
*
********************************************************************************	
	
	****************************************************************************
	*Figure 1. The importance of educational exchange programs
	****************************************************************************	
	
	*Loading dataset	
	use "$path\replication_data_figure_1.dta", clear	
		
	*Graph
	#delimit ;
	twoway (line foreignstuds year if year<=2018, lcolor(black) lwidth(*1.5))
		   (dropline foreignstuds year if year<=2018, mcolor(black) msize(*1) lcolor(gs12) lwidth(*0.5))	
		   ,
			ysize(1)
			xsize(1.25)			
			yscale(range(0 ) noextend titlegap(*+5))
			xscale(range( ) noextend titlegap(*+7))
			ylabel(0(250)1000, angle(horizontal) nogrid labgap(+1.5))
			xlabel(1950(10)2020)
			ytick(, tlength(*0.5))			
			xtick(1950(5)2020, tlength(*0.5))
			ytitle("Number of international students" "in the United States (in 1,000)")
			xtitle("Year")
			graphregion(color(white) lcolor(white) lalign(outside))
 			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_1.tif", as(tif) replace width(1500)			
				
	
	****************************************************************************
	*Figure 3. International seminar participants
	****************************************************************************		
	
	*Loading dataset	
	use "$path\replication_data_analysis_1.dta", clear	
	
	*Preserving data
	preserve
	
	*Keeping obs in sample
	keep if sample==1
	
	*Generating indicator for students from democratic countries
	gen allstuds_democ=allstuds if democ==1
		
	*Collapsing data
	collapse (sum) allstuds allstuds_democ, by(year)
	
	
	*Graph
	#delimit ;
	twoway (connected allstuds year, mfcolor(black) mlcolor(black) msize(*1) lcolor(black) lwidth(*0.75))
		   (connected allstuds_democ year, mfcolor(white) mlcolor(black) msize(*1) lcolor(black) lpattern(dot))
		   ,
			ysize(1)
			xsize(1.2)			
			yscale(range(0 80) noextend titlegap(*+5))
			xscale(range( ) noextend titlegap(*+7))
			ylabel(0(10)80, angle(horizontal) nogrid labgap(+1.5))
			xlabel(1952(4)1968)
			ytick(, tlength(*0.5))			
			xtick(1952(1)1968, tlength(*0.5))
			ytitle("Number of participants")
			xtitle("Year")
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(	
					 position(1)
					 ring(0)
					 row(2)
					 order(1 "All countries" 2 "Democratic countries")
					 size(*.8) keygap(*0.75) symxsize(*0.5) symysize(*0.5)					 
			)			
		   ;
	#delimit cr		
	graph export "$path\figure_3.tif", as(tif) replace width(1500)		
	
	*Restoring data
	restore			
	
	
	****************************************************************************
	*Figure 4. Participation across sectors
	****************************************************************************		
	
	*Preserving data
	preserve
	
	*Keeping obs in sample
	keep if sample==1
	
	*Collapsing data
	collapse (sum) allstuds allstuds_state allstuds_edu allstuds_mediacul
	
	*Generating proportion variables
	foreach var of varlist allstuds_state allstuds_edu allstuds_mediacul {
	    gen perc_`var'=(`var' / allstuds ) * 100		
	}
	
	*Reshaping data
	gen id=1
	reshape long perc@ , i(id) j() string
	sort perc
	gen xaxis=_n
		
	*Graph
	#delimit ;
	twoway (dropline perc xaxis, mcolor(black) lcolor(black) lwidth(*0.75))
		   ,
			ysize(1)
			xsize(1.2)			
			yscale(range(0 50) noextend titlegap(*+5))
			xscale(range(0.5 3.5) noextend titlegap(*+7))
			ylabel(0(10)50, angle(horizontal) nogrid)
			xlabel(3 `" " Media &" "Culture" "' 2 `" " State &" " Politics" "' 1 "Education")
			ytick(, tlength(*0.5))			
			ytitle("Percentage of participants")
			xtitle("Sector")
			graphregion(color(white) lcolor(white) lalign(outside)  margin(l=15 r=15)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_4.tif", as(tif) replace width(1500)			
	
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure 5. Distribution of dependent variable
	****************************************************************************		
	
	*Graph
	#delimit ;
	hist allstuds if sample==1
			,
			disc
			ysize(1)
			xsize(1.2)
			width(0.5)
			lwidth(0)
			fcolor(gs12)
			yscale(range() noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7))
			ylabel(, angle(horizontal) nogrid labgap(+1.5))
			xlabel()
			ytitle("Density")
			xtitle("Number of participants")
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_5.tif", as(tif) replace width(1500)	
		
	
	****************************************************************************
	*Figure 6. Seminar attendance and the level of democracy
	****************************************************************************
	
	*Preserving data
	preserve
	
	*Keeping obs in sample
	keep if sample==1
	
	*Collapsing data
    collapse (mean) mean=v2x_libdem (sd) sd=v2x_libdem (count) n=v2x_libdem, by(bin_allstuds)
    
	*Calculating 95% CIs
	generate hi = mean + invttail(n-1,0.025)*(sd / sqrt(n))
    generate lo = mean - invttail(n-1,0.025)*(sd / sqrt(n))
		
	*Graph
	#delimit ;
	twoway (bar mean bin_allstuds, lwidth(0) fcolor(gs13) barwidth(0.2)) 
		   (rspike hi lo bin_allstuds, lcolor(black) )
		   (scatter mean bin_allstuds, mlcolor(black) mfcolor(white) msize(*.9) mlwidth(*1.1) )			
			,
			ysize(1)
			xsize(1.2)			
			yscale(range(0 .5) noextend titlegap(*+5))
			xscale(range(-.5 1.5) noextend titlegap(*+7))
			ylabel(0(.1).5, angle(horizontal) nogrid labgap(+1.5))
			xlabel(0 "Countries w/o participants" 1 "Countries with participants")
			ytitle("Liberal democracy score")
			xtitle("")
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)				
		   ;
	#delimit cr		
	graph export "$path\figure_6.tif", as(tif) replace width(1500)	
	
	*Restoring data
	restore	
	
		
	****************************************************************************
	*Figure 7. Substantive effect
	****************************************************************************
	
	*Model 3
	#delimit ;
	reg allstuds 
		c.l_v2x_libdem
		c.l_ln_fuelpc
		c.l_ln_rgdpc
		c.l_ln_milperratio
		i.l_marxinsurg
		c.l_v2exl_legitideolcr_1
		c.l_hr_mean
		i.region6_1
		i.region6_2
		i.region6_3
		i.region6_4
		i.region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Generating rug elements
	gen modelobs=1 if e(sample)==1
	gen sym="|"
	gen yaxis=-.25	
	
	*Calculating marginal effects
	#delimit ;	
	margins, at((asobserved) _all l_v2x_libdem = (0(0.02)1)) 			 
			 level(95) 
			 post;
	#delimit cr
	
	*Graph
	#delimit ;	
	marginsplot,
			recastci(rspike)
			ciopts(lcolor(black) lwidth(*1)) 
			plotopts(mcolor(black) msize(*.8) lwidth(*1.25) lcolor(black))
			ysize(1)
			xsize(1.2)
			yscale(range(0 2) noextend titlegap(*+5))
			xscale(range(0 1) noextend titlegap(*+7))
			ylabel(0(.5)2.5, angle(horizontal) nogrid labgap(+1.5))
			xlabel(0(.1)1)
			ytitle("Predicted number of participants")
			xtitle("Liberal democracy score")
			title("")
			legend(off)
			plotregion(lcolor(white)) 
			graphregion(color(white) lcolor(white) lalign(outside))	
			addplot(scatter yaxis l_v2x_libdem if modelobs==1, 
					mlabposition(0) ms(none) mlabel(sym) mlabcolor(black%20) below
					ylabel(0(.5)2.5, angle(horizontal) nogrid labgap(+1.5))
					xlabel(0(.1)1)
					) 
			;
	#delimit cr		
	graph export "$path\figure_7.tif", as(tif) replace width(1500)
	
	
	****************************************************************************
	*Figure 8. Binary regime variables and seminar participation
	****************************************************************************	
	
	#delimit ;
	
	//Storing Model in local
	local model2_3=
	"	
	reg allstuds 
		i.l_autoc_elect 
		i.l_democ_elect 
		i.l_democ_liber 
		c.l_ln_fuelpc
		c.l_ln_rgdpc
		c.l_ln_milperratio
		i.l_marxinsurg
		c.l_v2exl_legitideolcr_1
		c.l_hr_mean
		i.region6_1
		i.region6_2
		i.region6_3
		i.region6_4
		i.region6_5
		if sample==1, vce(cluster cowcode)
	"
	;

	//Calculating effects
	`model2_3';	
	
	margins, at((asobserved) _all l_autoc_elect=0 l_democ_elect=0 l_democ_libe=0) 
			 level(95)
			 post;
	parmest, saving("$path\data_figure_8_1.dta", replace) level(95) idstr("closedautoc");
		
	//Calculating effects
	quiet `model2_3';	
		
	margins, at((asobserved) _all l_autoc_elect=1 l_democ_elect=0 l_democ_libe=0) 
			 level(95)
			 post;
	parmest, saving("$path\data_figure_8_2.dta", replace) level(95) idstr("elecautoc");
		
	//Calculating effects
	quiet `model2_3';	
	
	margins, at((asobserved) _all l_autoc_elect=0 l_democ_elect=1 l_democ_libe=0) 
			 level(95)
			 post;
	parmest, saving("$path\data_figure_8_3.dta", replace) level(95) idstr("elecdemoc");
		
	//Calculating effects
	quiet `model2_3';		
		
	margins, at((asobserved) _all l_autoc_elect=0 l_democ_elect=0 l_democ_libe=1) 
			 level(95)
			 post;
	parmest, saving("$path\data_figure_8_4.dta", replace) level(95) idstr("libdemoc");
	
	#delimit cr	
	
	*Preserving data
	preserve
	
	*Loading first effects dataset
	use "$path\data_figure_8_1.dta", clear
	
	*Appending other effects datasets
	foreach num of numlist 2 3 4 {
		append using "$path\data_figure_8_`num'.dta"
	} 
	
	*Generating xaxis
	sort estimate
	gen xaxis=_n
	
	*Graph
	#delimit ;
	twoway (rspike min95 max95 xaxis, lcolor(black) lwidth(*1))
		   (connected estimate xaxis, mcolor(black) msize(*1) lpattern(dot) lcolor(gs5)) 	
			,
			ysize(1)
			xsize(1.2)			
			yscale(range() noextend titlegap(*+5))
			xscale(range(0.75 4.25) noextend titlegap(*+7))
			ylabel(, angle(horizontal) nogrid labgap(+1.5))
			xlabel(
				   1 `" "Closed" "Autocracy" "' 
				   2 `" "Electoral" "Autocracy" "' 
				   3 `" "Electoral" "Democracy" "' 
				   4 `" "Liberal" "Democracy" "'
			)
			ytitle("Predicted number of participants")
			xtitle("Regime type")
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_8.tif", as(tif) replace width(1500)
	
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure 9. Within-autocracy differences in attendance
	****************************************************************************	
	
	*Preserving data
	preserve
	
	*Keeping obs in sample
	keep if sample==1
	
	*Generating regime indicator
	gen autoctype=1 if v2x_regime==0 
	replace autoctype=0 if v2x_regime==1 
	
	*Keeping observations for autocracies
	keep if autoctype!=.
	
	*Keeping years when students attended Seminar
	keep if allstuds!=0
	
	*Collapsing data by country
	collapse (sum) allstuds (median) autoctype (first) country_name, by(cowcode)
	
	*Replacing countries with "middle" category on autocracy type
	replace autoctype=1 if autoctype==0.5
	
	*Generating indicator for countries
	gen country=1
	
	*Collapsing data
	collapse (sum) allstuds country, by(autoctype)
		
	*Generating x-axis
	gen xaxis=0 if autoctype==1
	replace xaxis=1 if autoctype==0
		
	*Graph #1: Number of countries
	#delimit ;
	twoway (dropline country xaxis if autoctype==1, vertical mcolor(black) lcolor(black) lwidth(*0.5) msize(*1))
		   (dropline country xaxis if autoctype==0, vertical mcolor(black) mfcolor(white) lcolor(black) lwidth(*0.5) msize(*1.1))
		   ,
			ysize(1)
			xsize(1)			
			yscale(range(0 25) noextend titlegap(*+5))
			xscale(range(-.35 1.35) noextend titlegap(*+7))
			ylabel(0(10)30, valuelabel angle(horizontal) nogrid labsize(*1))
			xlabel(0 `" "Closed" "Autocracy" "' 1 `" "Electoral" "Autocracy" "', labsize(*1))
			ytitle("Count")
			xtitle("")
			title("Countries", size(*.75) box bexpand margin(t=1.25) color(black) fcolor(gs14) lcolor(black) lalign(center))
			graphregion(color(white) lcolor(white) lalign(outside) margin(l=15 r=15))
 			legend(off)
			name(country, replace)
		   ;
	#delimit cr		

	*Graph #2: Number of students
	#delimit ;
	twoway (dropline allstuds xaxis if autoctype==1, vertical mcolor(black) lcolor(black) lwidth(*0.5) msize(*1))
		   (dropline allstuds xaxis if autoctype==0, vertical mcolor(black) mfcolor(white) lcolor(black) lwidth(*0.5) msize(*1.1))
		   ,
			ysize(1)
			xsize(1)			
			yscale(range(0 180) noextend titlegap(*+5))
			xscale(range(-.35 1.35) noextend titlegap(*+7))
			ylabel(0(60)180, valuelabel angle(horizontal) nogrid labsize(*1))
			xlabel(0 `" "Closed" "Autocracy" "' 1 `" "Electoral" "Autocracy" "', labsize(*1))
			ytitle("Count", color(white))
			xtitle("")
			title("Participants", size(*.75) box bexpand margin(t=1.25) color(black) fcolor(gs14) lcolor(black) lalign(center))
			graphregion(color(white) lcolor(white) lalign(outside) margin(l=15 r=15))
 			legend(off)
			name(students, replace)
		   ;
	#delimit cr		
	
	*Combined graph
	#delimit ;
	graph combine country 
				  students 
					,
				  rows(1)
				  ysize(1) xsize(2)
				  iscale(*1.35)
				  graphregion(color(white) lcolor(white) lalign(outside))
				  ;
	#delimit cr	
	graph export "$path\figure_9.tif", as(tif) replace width(1500)	
	
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure 10. Representation of democracies at the time of the Seminar
	****************************************************************************

	*Preserving data
	preserve
	
	*Keeping years in sample
	keep if sample==1
	
	*Calculating number of countries in each year
	bys year (cowcode): egen numcountr=total(sample)

	*Calculating number of democracies in each year	
	bys year (cowcode): egen numdemoc=total(democ)
	
	*Calculating number 
	bys year (cowcode): egen numstudsdemoc=total(allstuds) if democ==1
		
	*Collapsing data
	collapse (sum) allstuds (first) numstudsdemoc numdemoc numcountr, by(year)
	
	*Calculating shares of democracies	
	gen share_democ_countrs=(numdemoc/numcountr)*100	
	
	*Calculating shares of students from democracies
	gen share_democ_studs=(numstudsdemoc/allstuds)*100
	
	*Calculating average shares
	foreach var of varlist share_democ_countrs share_democ_studs {
		egen mean_`var'=mean(`var')
	}
	
	*Reshaping data
	keep if _n==1
	
	*Keeping relevant variables
	keep mean*
	
	*Reshaping data from wide to long
	gen help=1
	reshape long mean_@, i(help) j() string
	
	*Generating x-axis
	gen xaxis=_n
	
	*Graph 
	#delimit ;
	twoway (connected mean_ xaxis, mcolor(black) lcolor(black) lwidth(*0.5) msize(*1))
			,
			ysize(1)
			xsize(1)			
			yscale(range(0 100) noextend titlegap(*+5))
			xscale(range(.5 2.5) noextend titlegap(*+7))
			ylabel(0(20)100, valuelabel angle(horizontal) nogrid labsize(*1))
			xlabel(1 `" "Countries" "with" "democracy" "' 2 `" "Participants" "from" "democracies" "', labsize(*1))	
			ytitle("Percentage")
			xtitle("")
			xline(1 2, lpattern(solid) lcolor(gs14))
			graphregion(color(white) lcolor(white) lalign(outside) margin(l=15 r=15))
 			legend(off)
		   ;
	#delimit cr				
	graph export "$path\figure_10.tif", as(tif) replace width(1500)	
	
	*Restoring data
	restore			
		
	
	****************************************************************************
	*Figure 11. Relative dominance of participants from democratic countries across time
	****************************************************************************
	
	*Preserving data
	preserve
	
	*Keeping obs in sample
	keep if sample==1
	
	*Generating variable on students from democracies and autoracies
	gen democstuds=allstuds if (v2x_regime==2 | v2x_regime==3) & allstuds>0 & allstuds!=.
	gen autocstuds=allstuds if (v2x_regime==0 | v2x_regime==1) & allstuds>0 & allstuds!=.
	
	*Collapsing data
	collapse (sum) democstuds autocstuds allstuds, by(year)
	
	*Generating proportion variables
    gen ratio_democ_autoc=(democstuds/autocstuds)	
	
	*Graph
	#delimit ;
	twoway (connected ratio_democ_autoc year, mfcolor(black) mlcolor(black) msize(*1) lcolor(black) lpattern(shortdash) lwidth(*0.75))
		   ,
			ysize(1)
			xsize(1)			
			yscale(range(0 4) noextend titlegap(*+5))
			xscale(range( ) noextend titlegap(*+7))
			ylabel(0(1)4, angle(horizontal) nogrid labgap(+1.5))
			xlabel(1952(4)1968)
			ytick(, tlength(*0.5))			
			xtick(1952(1)1968, tlength(*0.5))
			ytitle("Ratio of democratic to autocratic participants")
			xtitle("Year")
			yline(1, lpattern(dot) lcolor(black))
			graphregion(color(white) lcolor(white) lalign(outside)) 
			legend(off)
			;
	#delimit cr		
	graph export "$path\figure_11.tif", as(tif) replace width(1500)			
	
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure 12. Freedoms across sectors
	****************************************************************************	
	
	#delimit ;
			
	//Storing Model in local
	local model6_3=
	"
	reg allstuds
		c.l_v2clacfree 
		c.l_v2mecenefm
		c.l_v2clrspct
		c.l_ln_fuelpc
		c.l_ln_rgdpc
		c.l_ln_milperratio
		i.l_marxinsurg
		c.l_v2exl_legitideolcr_1
		c.l_hr_mean
		i.region6_1
		i.region6_2
		i.region6_3
		i.region6_4
		i.region6_5
		if sample==1, vce(cluster cowcode)
	"	
	;

	//Running model
	`model6_3';		
	
	//Calculating effects
	margins, dydx(l_v2clacfree l_v2mecenefm l_v2clrspct)
			 at((asobserved) _all) 			 
			 level(95) 
			 post;
	parmest, saving("$path\data_figure_12.dta", replace) format(estimate min95 max95);
	#delimit cr		
	
	*Preserving data
	preserve
	
	*Loading data
	use "$path\data_figure_12.dta", clear
		
	*Generating x-axis
	gen xaxis=1 if regexm(parm, "acfree")
	replace xaxis=3 if regexm(parm, "mec")
	replace xaxis=2 if regexm(parm, "clr")
	
	*Graph
	#delimit ;
	twoway (rspike min95 max95 xaxis, lcolor(black) lwidth(*1))
		   (scatter estimate xaxis, mcolor(black) msize(*1) ) 	
			,
			ysize(1)
			xsize(1)			
			yscale(range() noextend titlegap(*+5))
			xscale(range(0.75 2.25) noextend titlegap(*+5))
			ylabel(, angle(horizontal) nogrid labgap(+1.5))
			xlabel(
				   1 `" "Freedom of" "academia" "' 
				   3 `" "Freedom of" "media" "'
				   2 `" "Freedom of" "state admin." "'
				   , 
			)
			ytitle("Marginal effect on participation")
			xtitle(" ")
			yline(0, lpattern(dot) lcolor(black))
			graphregion(color(white) lcolor(white) lalign(outside) margin(l=15 r=15)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_12.tif", as(tif) replace width(1500)		
			
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure 13. Effect of universities and academic freedoms
	****************************************************************************		
	
	#delimit ;
			
	//Storing Model in local
	local model7_3=
	"
	reg allstuds 
		c.l_ln_v2canuni##c.l_v2clacfree
		c.l_ln_fuelpc
		c.l_ln_rgdpc
		c.l_ln_milperratio
		i.l_marxinsurg
		c.l_v2exl_legitideolcr_1
		c.l_hr_mean
		i.region6_1
		i.region6_2
		i.region6_3
		i.region6_4
		i.region6_5
		if sample==1, vce(cluster cowcode)
	"	
	;

	//Running model
	 `model7_3';	
	
	//Calculating effects
	margins, dydx(l_v2clacfree)
			 at((asobserved) _all l_ln_v2canuni = (0(0.1)6)) 			 
			 level(95) 
			 post;
	parmest, saving("$path\data_figure_13.dta", replace) format(estimate min95 max95) idstr("l_ln_v2canuni_X_l_v2clacfree");
	
	#delimit cr		
	
	*Preserving data
	preserve
	
	*Loading data
	use "$path\data_figure_13.dta", clear	
	
	*Generating x-axis
	gen rank=regexs(0) if regexm(parm,"^[0-9]+")
	destring rank, replace
	gen xaxis=(_n-1)*0.1
	gen axsis_rescale=exp(xaxis)
	
	*Graph
	#delimit ;
	twoway (rspike min95 max95 xaxis, lcolor(black) lwidth(*1))
		   (connected estimate xaxis, mcolor(black) msize(*.6) lwidth(*1.25) lcolor(black) ) 	
			,
			ysize(1)
			xsize(1.2)			
			yscale(range( ) noextend titlegap(*+5))
			xscale(range(0 6) noextend titlegap(*+5))
			ylabel(, angle(horizontal) nogrid labgap(+1))
			xlabel(0(1)6)
			ytitle("Marginal effect of academic freedom" "on participation in International Seminar")
			xtitle("Number of universities (log)")
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_13.tif", as(tif) replace width(1500)		
	
	*Restoring data
	restore
	
	
	****************************************************************************
	*Figure 14. Distribution of Confluence journal
	****************************************************************************
	
	*Preserving data
	preserve	
	
	*Generating region indicator for target audience of Confluence journal (Europe + Northern America)
	gen confluence_region=1 if (e_regiongeo==1 | e_regiongeo==2 |  e_regiongeo==3 |  e_regiongeo==4 |  e_regiongeo==16) & cowcode!=2	
	
	*Generating label variables
	gen labvar=country_name if ln_issuesize>=1 & ln_issuesize!=.
	replace labvar="Germany (West)" if country_name=="German Federal Republic" 
	gen labpos=2
	replace labpos=10 if cowcode==305
	replace labpos=9 if cowcode==210
	replace labpos=12 if cowcode==211
	
	*Graph
	#delimit ;
	twoway (scatter ln_issuesize v2x_libdem if confluence_region==1, mlwidth(0) mfcolor(gs3%40) mlabel(labvar) mlabsize(*.8) mlabcolor(black) mlabvposition(labpos)) 
		   (lfit ln_issuesize v2x_libdem if confluence_region==1, lcolor(black) lpattern(solid) lwidth(*1.5))
			,
			ysize(1)
			xsize(1.2)			
			yscale(range(0 8) noextend titlegap(*+5))
			xscale(range(0 1) noextend titlegap(*+7))
			ylabel(0(2)8, angle(horizontal) nogrid labgap(+1.5))
			xlabel(0(.1)1)
			ytitle("Number of copies (logged)")
			xtitle("Liberal democracy score")
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_14.tif", as(tif) replace width(1500)	
	
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure 15. Foreign policy of former participants
	****************************************************************************	
	
	*Loading dataset
	use "$path\replication_data_figure_15.dta", clear
		
	*Graph #1: United States
	#delimit ;	
	twoway (line mean_us_fpsim_selec fullwin_selec, lcolor(black) lpattern(shortdash) lwidth(*1))
		   (dropline mean_us_fpsim_selec fullwin_selec, mcolor(black) msize(*1) lcolor(black) lwidth(*1))		
					,
					ysize(1)
					xsize(1.1) 
					yscale(range(-0.2 0.2) noline titlegap(*+5))
					xscale(range(-3.25 3.25) noline titlegap(*+10)) 
					ylabel(-0.2(0.1)0.2, 
							nogrid labsize(*.9) angle(0)
					)
					xlabel(-3(1)0 1 "+1" 2 "+2" 3 "+3",
							labsize(*.9)
					)
					xticks(,tlength(*1))
					xline(0, lcolor(gs15) lwidth(*20))
					ytitle("Similarity with foreign policy", size(*1.1))
					xtitle("Year", size(*1.1))
					legend(off)	
					yline(0,lcolor(gs12))
					plotregion(lcolor(black) lalign(outside))
					graphregion(color(white) lcolor(white) lalign(outside))
					subtitle("United States", size(*1) box bexpand margin(t=1.25) fcolor(gs14) lcolor(black) lalign(center))
					name(us_fpsim, replace)	
					; 
	#delimit cr		
		
	*Graph #1: Soviet Union
	#delimit ;	
	twoway (line mean_rus_fpsim_selec fullwin_selec, lcolor(black) lpattern(shortdash) lwidth(*1))
		   (dropline mean_rus_fpsim_selec fullwin_selec, mcolor(black) msize(*1) lcolor(black) lwidth(*1))		
					,
					ysize(1)
					xsize(1.1) 
					yscale(range(-0.2 0.2) noline titlegap(*+5))
					xscale(range(-3.25 3.25) noline titlegap(*+10)) 
					ylabel(-0.2(0.1)0.2, 
							nogrid labsize(*.9) angle(0)
					)
					xlabel(-3(1)0 1 "+1" 2 "+2" 3 "+3",
							labsize(*.9)
					)
					xticks(,tlength(*1))
					xline(0, lcolor(gs15) lwidth(*20))
					ytitle("Similarity with foreign policy", size(*1.1) color(white))
					xtitle("Year", size(*1.1))
					legend(off)	
					yline(0,lcolor(gs12))
					plotregion(lcolor(black) lalign(outside))
					graphregion(color(white) lcolor(white) lalign(outside))
					subtitle("Soviet Union", size(*1) box bexpand margin(t=1.25) fcolor(gs14) lcolor(black) lalign(center))
					name(rus_fpsim, replace)
					; 
	#delimit cr		
			
	*Combined graph	
	#delimit ;	
	graph combine us_fpsim rus_fpsim
		  ,
		  row(1)
		  iscale(*1.2)
		  ysize(1)
		  xsize(1.75)
		  graphregion(color(white) lcolor(white) lalign(outside))	
		  ; 
	#delimit cr				
	graph export "$path\figure_15.tif", as(tif) replace width(1500)	

	
	****************************************************************************
	*Figure 16. Seminar participation and subsequent state visits by Kissinger
	****************************************************************************
	
	*Loading dataset
	use "$path\replication_data_analysis_2.dta", clear
	
	*Model 2
	#delimit ;
			
	//Storing Model in local
	local model19_2=
	"	
	reg ln_nsctravel 
		c.allstuds_state 
		c.allstuds_edu 
		c.allstuds_mediacul 
		c.v2x_libdem 
		c.mean_ln_milperratio 
		i.y2
		i.y3
		i.y4
		i.y5
		i.y6
		i.y7	
		i.y8		
		i.region19_2
		i.region19_3		
		i.region19_4		
		i.region19_5		
		i.region19_6
		i.region19_7		
		i.region19_8		
		i.region19_9
		i.region19_10
		i.region19_11		
		i.region19_12		
		i.region19_13
		i.region19_14
		i.region19_15		
		i.region19_16		
		i.region19_17			
		i.region19_18
		,
		robust
	"	
	;
	
	//Running model
	`model19_2';		
	
	//Calculating effects
	margins, dydx(allstuds_state allstuds_edu allstuds_mediacul)
			 expression((exp(predict(xb)))-1)
			 at((asobserved) _all) 			 
			 level(95) 
			 post;
	parmest, saving("$path\data_figure_13_1.dta", replace) format(estimate min95 max95) idstr("nsc");
	#delimit cr		
	
	*Model 4
	#delimit ;
			
	//Storing Model in local
	local model19_4=
	"	
	reg ln_secstatetravel 
		c.allstuds_state 
		c.allstuds_edu 
		c.allstuds_mediacul 
		c.v2x_libdem 
		c.mean_ln_milperratio 
		i.y2
		i.y3
		i.y4
		i.y5
		i.y6
		i.y7	
		i.y8		
		i.region19_2
		i.region19_3		
		i.region19_4		
		i.region19_5		
		i.region19_6
		i.region19_7		
		i.region19_8		
		i.region19_9
		i.region19_10
		i.region19_11		
		i.region19_12		
		i.region19_13
		i.region19_14
		i.region19_15		
		i.region19_16		
		i.region19_17			
		i.region19_18
		,
		robust
	"
	;
	
	//Running model
	`model19_4';		
	
	//Calculating effects
	margins, dydx(allstuds_state allstuds_edu allstuds_mediacul)
			 expression((exp(predict(xb)))-1)
			 at((asobserved) _all) 			 
			 level(95) 
			 post;
	parmest, saving("$path\data_figure_13_2.dta", replace) format(estimate min95 max95) idstr("secstate");
	#delimit cr		
	
	*Loading data
	use "$path\data_figure_13_1.dta", clear		
	append using "$path\data_figure_13_2.dta"	
	
	*Generating group variable
	egen depvar=group(idstr)
	
	*Generating x-axis
	gen yaxis = .
	replace yaxis = 3 if parm=="allstuds_edu"
	replace yaxis = 2 if parm=="allstuds_mediacul"
	replace yaxis = 1 if parm=="allstuds_state"
	
	sort depvar yaxis
	
	*Labeling group variable
	#delimit ;
	label define vars 
			1 "National Security Advisor"
			2 "Secretary of State"
			;
	#delimit cr
	
	label values depvar vars	
	
	*Graph
	#delimit ;		
	twoway rspike min95 max95 yaxis, //95% CI
					 horizontal lcolor(black) lwidth(*1)	
		  || scatter yaxis  estimate if yaxis==1, //Mean			  
				 msymbol(o) msize(*1.5) mlwidth(*1.5) mcolor(black) mfcolor(white) mlalign(center)
		  || scatter yaxis estimate if yaxis==2, //Mean			  
				 msymbol(o) msize(*1.5) mlwidth(*1.5) mcolor(black) mfcolor(gs14) mlalign(center)
		  || scatter yaxis estimate if yaxis==3, //Mean			  
				 msymbol(o) msize(*1.5) mlwidth(*1.5) mcolor(black) mfcolor(black) mlalign(center)		 
				 by(depvar, row(1) legend(off)
					note("") graphregion(color(white) lcolor(white) lalign(outside))
					imargin(0 *1.25 0 0)
				 ) 
				 xsize(1.5) 
				 ysize(1)
				 xscale(range(-.02 .04) noline)
				 yscale(range(0.5 3.5) noline)				 
 	             ylabel(1 "State/Politics" 2 "Media/Culture" 3 "Education", nogrid angle(0) labsize(*1.2)) 
				 xlabel(-.02(0.01).04, angle(horizontal) nogrid labsize(*1.1))
				 xticks()
				 xline(0,lpattern(shortdash) lwidth(thin) lcolor(black))
				 subtitle(, size(*1.1) lcolor(black))
				 ytitle(" ", size(*1.1))
				 xtitle("	  Marginal effect on visits", color(black) size(*1.1)  margin(0 -15 0 0))
				 subtitle(, size(*1) box bexpand margin(t=1.25) fcolor(gs14) lcolor(black) lalign(center))
				 plotregion(lcolor(black))	
				 ; 
	#delimit cr		
	graph export "$path\figure_16.tif", as(tif) replace width(1500)	

	
	
********************************************************************************
*
* Figures in supporting information
*
********************************************************************************	
	
	****************************************************************************
	*Figure SM.1.1. Global participation
	****************************************************************************	
	
	*Loading dataset
	use "$path\replication_data_figure_SM_1_1.dta", clear
	
	*Graph
	#delimit ;
	spmap allstuds using "$path\replication_data_figure_SM_1_1_shapes.dta", 
		  id(_ID)
		  clmethod(custom)
		  clbreaks(0 0.9 5.5 15.5 30.5 60)
		  ocolor(black)
		  osize(0.04)
		  fcolor("250 250 250" "189 215 231" "107 174 214" "49 130 189" "8 81 156")
		 legtitle("Number of participants") 		 
		 legend(symy(*1.7) symx(*1.7) size(*1.7)
		 label(2 "0") 
		 label(3 "1-5") 
		 label(4 "6-15") 
		 label(5 "16-30") 
		 label(6 "31-60") 
		 )		
	;
	#delimit cr
	graph export "$path\figure_SM_1_1.pdf", replace as(pdf)
	
	
	****************************************************************************
	*Figure SM.2.1. Substantive effect of age of democracy
	****************************************************************************		
	
	*Loading dataset	
	use "$path\replication_data_analysis_1.dta", clear	
	
	*Calculating effects
	#delimit ;
			
	//Storing Model in local
	local model21_3=
	"
	reg allstuds 
		c.democ_years##c.democ_years##c.democ_years
		c.l_ln_fuelpc
		c.l_ln_rgdpc
		c.l_ln_milperratio
		i.l_marxinsurg
		c.l_v2exl_legitideolcr_1
		c.l_hr_mean
		i.region6_1
		i.region6_2
		i.region6_3
		i.region6_4
		i.region6_5
		if sample==1, vce(cluster cowcode)
	"	
	;

	//Running model
	 `model21_3';		
	
	//Empirical range
	sum democ_years if e(sample)==1 ;
	
	//Calculating effects
	margins, at((asobserved) _all democ_years = (0(0.1)1.9)) 			 
			 level(95) 
			 post;
	parmest, saving("$path\data_figure_SM_2_1.dta", replace) format(estimate min95 max95) idstr("democ_years");
	#delimit cr		
		
	*Preserving data
	preserve
	
	*Loading data
	use "$path\data_figure_SM_2_1.dta", clear	
	
	*Generating x-axis
	gen democ_years=(_n-1)
		
	*Graph
	#delimit ;
	twoway (rspike min95 max95 democ_years, lcolor(black) lwidth(*1))
		   (connected estimate democ_years, mcolor(black) msize(*.8) lwidth(*1.25) lcolor(black) ) 	
			,
			ysize(1)
			xsize(1.2)			
			yscale(range(0 2) noextend titlegap(*+5))
			xscale(range(0 19) noextend titlegap(*+7))
			ylabel(0(.5)2, angle(horizontal) nogrid labgap(+1.5))
			xlabel(0(1)19)
			ytitle("Predicted number of participants")
			xtitle("Age of democracy")
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_SM_2_1.pdf", replace as(pdf)
	
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure SM.3.1. Seminar attendance across regimes
	****************************************************************************	
	
	*Preserving data
	preserve
	
	*Keeping years in sample
	keep if sample==1
	
	*Collapsing data
	collapse (sum) allstuds, by(democ)
			
	*Calculating shares
	egen total=total(allstuds)
	gen share=(allstuds/total)*100
	list 
	
	*Graph
	#delimit ;
	twoway (dropline allstuds democ if democ==1, vertical mcolor(black) lcolor(black) lwidth(*0.5) msize(*1))
		   (dropline allstuds democ if democ==0, vertical mcolor(black) mfcolor(white) lcolor(black) lwidth(*0.5) msize(*1.1))
		   ,
			ysize(1)
			xsize(1)			
			yscale(range(0 180) noextend titlegap(*+5))
			xscale(range(-.35 1.35) noextend titlegap(*+7))
			ylabel(0(100)400, valuelabel angle(horizontal) nogrid labsize(*1))
			xlabel(0 "Autocracy" 1 "Democracy", labsize(*1))
			ytitle("Number of participants")
			xtitle("")
			graphregion(color(white) lcolor(white) lalign(outside) margin(l=15 r=15))
 			legend(off)
			;
	#delimit cr		
	graph export "$path\figure_SM_3_1.pdf", replace as(pdf)
		
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure SM.3.2. Seminar attendance from Communist Bloc
	****************************************************************************
	
	*Preserving data
	preserve
	
	*Keeping years in sample
	keep if sample==1	
	
	*Generating variable in Communist Bloc
	gen communist_bloc=.
	
	#delimit ;
	replace communist_bloc=1 if 
			country_name=="Russia" 		|
			country_name=="Albania" 	|
			country_name=="Bulgaria" 	|
			country_name=="Czech Republic" 	|
			country_name=="German Democratic Republic" |
			country_name=="Hungary" 	|
			country_name=="Poland" 		|			
			country_name=="Romania" 	|
			country_name=="Yugoslavia" 		
	;
	#delimit cr
	
	*Generating variables on student number from communist regimes
	gen communist_bloc_studs=allstuds if communist_bloc==1 	//Warsaw Pact
	gen communist_regi_studs=allstuds if comreg==1		  	//Communist regimes
	
	*Collapsing data
	collapse (sum) communist_bloc_studs	communist_regi_studs allstuds
	
	*Calculating shares
	foreach var of varlist communist_bloc_studs communist_regi_studs {
		gen share_`var'=(`var'/allstuds)*100
	}
	
	*Reshaping data
	gen help=1
	reshape long share@, i(help) j() string	
	rename _j var
	
	*Keeping relevant variables
	keep share var
	
	*Generating x-axis
	gen xaxis=_n

	*Graph
	#delimit ;
	twoway (dropline share xaxis, vertical mcolor(black) lcolor(black) lwidth(*0.5) msize(*1))
		   ,
			ysize(1)
			xsize(1)			
			yscale(range(0 8) noextend titlegap(*+5))
			xscale(range(0.5 2.5) noextend titlegap(*+7))
			ylabel(0(2)8, valuelabel angle(horizontal) nogrid labsize(*1))
			xlabel(1 `" "Warsaw" "Pact" "'  2 `" "Communist" "Regimes" "', labsize(*1))
			ytitle("Percentage of participants")
			xtitle("")
			graphregion(color(white) lcolor(white) lalign(outside) margin(l=15 r=15))
 			legend(off)
			;
	#delimit cr			
	graph export "$path\figure_SM_3_2.pdf", replace as(pdf)
	
	*Restoring data
	restore	
		
	
	
********************************************************************************
*
* Tables in manuscript
*
********************************************************************************
	
	****************************************************************************
	*Table 1. Linear regression for attendance of Harvard International Seminar
	****************************************************************************	
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr

	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 	

	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	
	
********************************************************************************
*
* Tables in online appendix
*
********************************************************************************	
	
	****************************************************************************
	*Table SM.1.1. Summary statistics
	****************************************************************************		
	
	#delimit ;
	estpost sum 
		allstuds
		ln_allstuds		
		bin_allstuds		
		
		l_v2x_libdem
		l_v2x_polyarchy
		l_v2x_partipdem
		l_v2x_delibdem
		
		l_autoc_close
		l_autoc_elect 
		l_democ_elect 
		l_democ_liber 	
	
		l_regdiff_libdem
	
		democ_years
		democ_years2
		democ_years3	
	
		l_v2clacfree 
		l_v2mecenefm
		l_v2clrspct		
		l_ln_v2canuni 	 
		
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		
		l_us_influence
		l_rus_influence			
		l_us_fpsim_inv
		l_diff_us_fpsim_inv
		l_c_totdyadtraperc			
		l_ln_pop
		l_us_totdyadtraperc	
		l_communistcso		
		l_comneighb_mean_vdem	
		ln_disttous
		
		l_noncomreg
		l_leader_right
		l_leader_centrist
		
		if sample==1
		;
	#delimit cr
	
	
	****************************************************************************
	*Table SM.2.1. Count measure of attendance
	****************************************************************************	
	
	*Model 1
	#delimit ;
	reg ln_allstuds 
		l_v2x_libdem 
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg ln_allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
	
	*Model 3
	#delimit ;
	reg ln_allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 4
	#delimit ;
	poisson allstuds 
		l_v2x_libdem 
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 5
	#delimit ;
	poisson allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
		
	*Model 6
	#delimit ;
	poisson allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			

	
	****************************************************************************
	*Table SM.2.2. Different region fixed effects
	****************************************************************************		
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		region10_1-region10_9
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
		
	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region10_1-region10_9
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
		
	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		region19_1-region19_17
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 4
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region19_1-region19_17
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		

	
	****************************************************************************
	*Table SM.2.3. Binary measure of attendance
	****************************************************************************
	
	*Model 1
	#delimit ;
	reg bin_allstuds 
		l_v2x_libdem 
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg bin_allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
	
	*Model 3
	#delimit ;
	reg bin_allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 4
	#delimit ;
	logit bin_allstuds 
		l_v2x_libdem 
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 5
	#delimit ;
	logit bin_allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
	
	*Model 6
	#delimit ;
	logit bin_allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		

	
	****************************************************************************
	*Table SM.2.4. Different democracy measures
	****************************************************************************	
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_polyarchy
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_polyarchy
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr	
	
	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_partipdem
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 4
	#delimit ;
	reg allstuds 
		l_v2x_partipdem
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr	
	
	*Model 5
	#delimit ;
	reg allstuds 
		l_v2x_delibdem
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 6
	#delimit ;
	reg allstuds 
		l_v2x_delibdem
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr	

	
	****************************************************************************
	*Table SM.2.5. Measures on regime difference
	****************************************************************************
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_regdiff_libdem 
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr 
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_regdiff_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
		
	*Model 3
	#delimit ;
	reg allstuds 
		l_regdiff_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
		
	*Model 4
	#delimit ;
	reg allstuds 
		l_regdiff_polyarchy 
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr 	
	
	*Model 5
	#delimit ;
	reg allstuds 
		l_regdiff_polyarchy
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 6
	#delimit ;
	reg allstuds 
		l_regdiff_polyarchy
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		

	
	****************************************************************************
	*Table SM.2.6. Regime types (Reference category: Closed autocracy)
	****************************************************************************
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_autoc_elect 
		l_democ_elect 
		l_democ_liber 
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_autoc_elect 
		l_democ_elect 
		l_democ_liber   
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
	
	*Model 3
	#delimit ;
	reg allstuds
		l_autoc_elect 
		l_democ_elect 
		l_democ_liber	
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr	
	
	
	****************************************************************************
	*Table SM.2.7. Age of democracy
	****************************************************************************
	
	*Model 1
	#delimit ;
	reg allstuds
		democ_years
		democ_years2
		democ_years3
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds 
		democ_years
		democ_years2
		democ_years3
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
		
	*Model 3
	#delimit ;
	reg allstuds 
		democ_years
		democ_years2
		democ_years3
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
		
	
	****************************************************************************
	*Table SM.2.8. Additional controls for country’s political importance
	****************************************************************************
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		l_ln_pop
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		l_comneighb_mean_vdem
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
	
	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		l_us_totdyadtraperc			
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 4
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		
		l_ln_pop
		l_comneighb_mean_vdem
		l_us_totdyadtraperc		
		
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	
	****************************************************************************
	*Table SM.2.9. Communist threats in liberal democracies
	****************************************************************************
	
	*Generating interactions
	gen l_libdem_X_marxinsurg = l_v2x_libdem * l_marxinsurg
	gen l_libdem_X_communistcso = l_v2x_libdem * l_communistcso
	gen l_libdem_X_comneighb = l_v2x_libdem * l_comneighb_mean_vdem	
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_communistcso
		l_libdem_X_communistcso		
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
			
	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_communistcso
		l_libdem_X_communistcso		
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
	
	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_marxinsurg
		l_libdem_X_marxinsurg		
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
		
	*Model 4
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_marxinsurg
		l_libdem_X_marxinsurg		
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
	
	*Model 5
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_comneighb_mean_vdem		
		l_libdem_X_comneighb		
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		

	*Model 6
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_comneighb_mean_vdem		
		l_libdem_X_comneighb		
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
	
	
	****************************************************************************
	*Table SM.2.10. Leave-one-out outlier test
	****************************************************************************	
	
	*Identifying outliers
	gen leavout=1 if cowcode==750 | cowcode==770 | cowcode==325 | cowcode==220 | cowcode==740 | cowcode==200 | cowcode==260
	
	*Storing outlier information in macro
	levelsof cowcode if leavout==1, local(count)
	
	*Model 
	#delimit ;
	foreach x of local count { ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1 & cowcode!=`x', vce(cluster cowcode)
		;
	} ;
	#delimit cr						
				
	
	****************************************************************************
	*Table SM.2.11. Endogeneity test
	****************************************************************************	
	
	*Preserving data
	preserve
	
	*Aggregating student numbers
	bysort cowcode (year): egen allstuds_sum=total(allstuds), missing
	
	*Reducing data to cross-section (year=1951 with lagged vars -> values==1950)
	keep if year==1951
		
	*Model 1
	#delimit ;
	reg allstuds_sum 
		l_v2x_libdem 
		, vce(robust)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds_sum 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		, vce(robust)
		;
	#delimit cr				 
		
	*Model 3
	#delimit ;
	reg allstuds_sum 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		, vce(robust)
		;
	#delimit cr			
	
	*Model 4
	#delimit ;
	nbreg allstuds_sum 
		l_v2x_libdem 
		, vce(robust)
		;
	#delimit cr
	
	*Model 5
	#delimit ;
	nbreg allstuds_sum 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		, vce(robust)
		;
	#delimit cr				 
		
	*Model 6
	#delimit ;
	nbreg allstuds_sum 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		, vce(robust)
		;
	#delimit cr			
	
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Table SM.3.2. Geographic distance, economic development, and applications
	****************************************************************************
	
	*Model 1
	#delimit ;
	reg bin_allstuds 
		c.ln_disttous##c.l_ln_rgdpc
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr	
	
	*Model 2
	#delimit ;
	reg bin_allstuds 
		c.ln_disttous##c.l_ln_rgdpc
		l_ln_fuelpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
		
	*Model 3
	#delimit ;
	logit bin_allstuds 
		c.ln_disttous##c.l_ln_rgdpc
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
	
	*Model 4
	#delimit ;
	logit bin_allstuds 
		c.ln_disttous##c.l_ln_rgdpc
		l_ln_fuelpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	
	****************************************************************************
	*Table SM.3.3. Geographic distance, population size, and applications
	****************************************************************************
	
	*Model 1
	#delimit ;
	reg bin_allstuds 
		c.ln_disttous##c.l_ln_pop
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
		
	*Model 2
	#delimit ;
	reg bin_allstuds 
		c.ln_disttous##c.l_ln_pop
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 3
	#delimit ;
	logit bin_allstuds 
		c.ln_disttous##c.l_ln_pop
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
	
	*Model 4
	#delimit ;
	logit bin_allstuds 
		c.ln_disttous##c.l_ln_pop
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr

	
	****************************************************************************
	*Table SM.3.4. Two-stage selection process
	****************************************************************************
	
	*Generating binary dependent variable for selection stage
	gen allstuds_posint=allstuds if bin_allstuds==1
	
	*Model 1
	#delimit ;
	heckman allstuds_posint 
		l_v2x_libdem 
		if sample==1
		, 
		select(
		bin_allstuds =
		ln_disttous
		)
		vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	heckman allstuds_posint 
		l_v2x_libdem 	
		if sample==1
		, 
		select(
		bin_allstuds =
		ln_disttous
		region6_1-region6_5		
		)
		vce(cluster cowcode)
		;
	#delimit cr		 
		
	*Model 3
	#delimit ;
	heckman allstuds_posint 
		l_v2x_libdem 
		if sample==1
		, 
		select(
		bin_allstuds =
		ln_disttous
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		)
		vce(cluster cowcode)
		;
	#delimit cr		

	
	****************************************************************************
	*Table SM.3.5. Excluding core communist regimes
	****************************************************************************	
		
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		if sample==1 & cowcode!=710, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1 & cowcode!=710, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		if sample==1 & 	
		cowcode!=365
		, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 4	
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1 & cowcode!=365, vce(cluster cowcode)
		;
	#delimit cr	

	*Model 5
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		if sample==1 & cowcode!=731, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 6	
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1 & cowcode!=731, vce(cluster cowcode)
		;
	#delimit cr			

	*Model 7
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		if sample==1 & comreg!=1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 8	
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1 & comreg!=1, vce(cluster cowcode)
		;
	#delimit cr		
	
		
	****************************************************************************
	*Table SM.3.6. Controlling for regimes without communist ideology
	****************************************************************************	
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_noncomreg
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_noncomreg
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 

	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_noncomreg
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
	
	
	****************************************************************************
	*Table SM.3.7. Ideologies across regimes
	****************************************************************************
	
	*Generating interactions
	gen l_v2x_libdem_X_l_leader_right = l_v2x_libdem * l_leader_right
	gen l_v2x_libdem_X_l_leader_centrist = l_v2x_libdem * l_leader_centrist
		
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_leader_right
		l_v2x_libdem_X_l_leader_right 		
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_leader_right
		l_v2x_libdem_X_l_leader_right 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
	
	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_leader_centrist
		l_v2x_libdem_X_l_leader_centrist 		
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 4
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_leader_centrist
		l_v2x_libdem_X_l_leader_centrist 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			

	*Model 5
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_leader_right
		l_leader_centrist
		l_v2x_libdem_X_l_leader_right 	
		l_v2x_libdem_X_l_leader_centrist 		
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 6
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_leader_right
		l_leader_centrist
		l_v2x_libdem_X_l_leader_right 	
		l_v2x_libdem_X_l_leader_centrist 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
	
	
	****************************************************************************
	*Table SM.3.8. Country’s pre-existing relations with the United States
	****************************************************************************
		
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		l_us_fpsim_inv	
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		l2_us_fpsim_inv	
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		l_c_totdyadtraperc
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 4
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		l2_c_totdyadtraperc
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 5
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		l_us_fpsim_inv	
		l_c_totdyadtraperc
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Model 6
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		l2_us_fpsim_inv	
		l2_c_totdyadtraperc
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
		
		
		
	****************************************************************************
	*Table SM.3.9. Democracies tilting away from the United States
	****************************************************************************
	
	*Generating interactions 
	gen l_libdem_X_l_diff_us_fpsim = l_v2x_libdem * l_diff_us_fpsim_inv
	gen l_democ_X_l_diff_us_fpsim = l_democ * l_diff_us_fpsim_inv
			
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_libdem_X_l_diff_us_fpsim
		l_v2x_libdem
		l_diff_us_fpsim_inv
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_libdem_X_l_diff_us_fpsim
		l_v2x_libdem
		l_diff_us_fpsim_inv
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
		
	*Model 3
	#delimit ;
	reg allstuds 
		l_libdem_X_l_diff_us_fpsim
		l_v2x_libdem
		l_diff_us_fpsim_inv
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		

	*Model 4
	#delimit ;
	reg allstuds 
		l_democ_X_l_diff_us_fpsim
		l_democ
		l_diff_us_fpsim_inv
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr

	*Model 5
	#delimit ;
	reg allstuds 
		l_democ_X_l_diff_us_fpsim
		l_democ
		l_diff_us_fpsim_inv
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
		
	*Model 6
	#delimit ;
	reg allstuds 
		l_democ_X_l_diff_us_fpsim
		l_democ
		l_diff_us_fpsim_inv
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		

	
	****************************************************************************
	*Table SM.3.10. Controlling for hard power
	****************************************************************************	

	*Model 1
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_us_influence
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_us_influence
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
		
	*Model 3
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_us_influence
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
	
	*Model 4
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_us_influence
		l_rus_influence
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 5
	#delimit ;
	reg allstuds 
		l_v2x_libdem 
		l_us_influence
		l_rus_influence
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
		
	*Model 6
	#delimit ;
	reg allstuds 
		l_v2x_libdem
		l_us_influence
		l_rus_influence
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr			
	
	
	****************************************************************************
	*Table SM.4.1. Distinguishing freedom in education, state, and media sector
	****************************************************************************
	
	*Model 1
	#delimit ;
	reg allstuds 
		l_v2clacfree 
		l_v2mecenefm
		l_v2clrspct
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr
	
	*Model 2
	#delimit ;
	reg allstuds
		l_v2clacfree 
		l_v2mecenefm
		l_v2clrspct
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				 
	
	*Model 3
	#delimit ;
	reg allstuds
		l_v2clacfree 
		l_v2mecenefm
		l_v2clrspct
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	
	****************************************************************************
	*Table SM.4.2. Academic freedoms and institutional context
	****************************************************************************	
		
	*Model 1
	#delimit ;
	reg allstuds 
		l_ln_v2canuni
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr	
	
	*Model 2
	#delimit ;
	reg allstuds 
		l_ln_v2canuni
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr		
	
	*Generating interaction
	gen l_ln_v2canuni_X_l_v2clacfree = l_ln_v2canuni * l_v2clacfree

	*Model 3
	#delimit ;
	reg allstuds 
		l_ln_v2canuni_X_l_v2clacfree 
		l_ln_v2canuni 
		l_v2clacfree
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr	
	
	*Model 4
	#delimit ;
	reg allstuds
		l_ln_v2canuni_X_l_v2clacfree 
		l_ln_v2canuni 
		l_v2clacfree	
		l_ln_fuelpc
		l_ln_rgdpc
		l_ln_milperratio
		l_marxinsurg
		l_v2exl_legitideolcr_1
		l_hr_mean
		region6_1-region6_5
		if sample==1, vce(cluster cowcode)
		;
	#delimit cr				

	
	****************************************************************************
	*Table SM.1.2. Summary statistics on effects
	****************************************************************************
	
	*Loading dataset	
	use "$path\replication_data_analysis_2.dta", clear	
	
	*Table
	#delimit ;
	sum 	
		ln_nsctravel 
		ln_secstatetravel
		ln_delibtravel
		
		allstuds
		allstuds_state 
		allstuds_edu 
		allstuds_mediacul
		
		v2x_libdem 
		mean_ln_milperratio 		
		;
	#delimit cr	
	
	
	****************************************************************************
	*Table SM.4.3. International Seminar participation and state visits by Kissinger
	****************************************************************************
	
	*Model 1
	#delimit ;
	reg ln_nsctravel 
		allstuds 
		v2x_libdem 
		mean_ln_milperratio 
		y2-y8 
		region19_2-region19_18
		,
		robust
	;
	#delimit cr
		
	*Model 2
	#delimit ;
	reg ln_nsctravel 
		allstuds_state 
		allstuds_edu 
		allstuds_mediacul 
		v2x_libdem 
		mean_ln_milperratio 
		y2-y8 
		region19_2-region19_18
		,
		robust
	;
	#delimit cr	
		
	*Model 3
	#delimit ;
	reg ln_secstatetravel 
		allstuds
		v2x_libdem 
		mean_ln_milperratio 
		y2-y8 
		region19_2-region19_18
		,
		robust	
	;
	#delimit cr
		
	*Model 4
	#delimit ;
	reg ln_secstatetravel 
		allstuds_state 
		allstuds_edu 
		allstuds_mediacul 
		v2x_libdem 
		mean_ln_milperratio 
		y2-y8 
		region19_2-region19_18
		,
		robust	
	;
	#delimit cr	

	*Model 5
	#delimit ;	
	reg ln_delibtravel 		
		allstuds
		v2x_libdem 
		mean_ln_milperratio 
		y2-y8 
		region19_2-region19_18
		,
		robust	
	;
	#delimit cr	
	
	*Model 6
	#delimit ;	
	reg ln_delibtravel 		
		allstuds_state 
		allstuds_edu 
		allstuds_mediacul 
		v2x_libdem 
		mean_ln_milperratio 
		y2-y8 
		region19_2-region19_18
		,
		robust	
	;
	#delimit cr	
	


********************************************************************************	
*
*
*	
********************************************************************************		
	
	*Closing graph windows
	graph close _all 
	
	*Clearing data
	clear all
	
	*End recording log file
	log close	
	
